% SL Script to control PDF generation, set the trim/crop/bleed boxes
% FYI: setupPage ( float translate_x, float translate_y, float rotate, float scale_x, float scale_y, int keepOnSamePage )

define pdf_page_setup(pagenum) {
	% do not change the page
	variable targetWidth = pageWidth();
	variable targetHeight = pageHeight();
	
	% The next line has no direct effect, however it silently forces PStill to disregard all
	% Trim/Crop and Bleedboxes in the source job
	
	setupPage(0, 0, 0.0, 1, 1, 0);	
	
	% remember to typecast for this call, it needs integer
	setMediaBox(int(targetWidth),int(targetHeight));
	
	% setup the boxes - 0,0 is lower left like always, measure in pts
	% remember: you need to turn on PDF/X processing otherwise they are not written
	

	variable trimXY = 36;
	variable bleedXY = (trimXY - 9);

	variable trimWidth = (targetWidth - trimXY);
	variable trimHeight = (targetHeight - trimXY);

	variable bleedWidth = (targetWidth - bleedXY);
	variable bleedHeight = (targetHeight - bleedXY);
	
	setTrimBox(trimXY,trimXY,trimWidth,trimHeight);
	setBleedBox(bleedXY,bleedXY,bleedWidth,bleedHeight);

	% setCropBox(0,0,targetWidth,targetHeight);
	setCropBox(trimXY,trimXY,trimWidth,trimHeight);

}

% no annotation processing for this run

define action_pdfmark(s,n) {

}

